<template>
  <div class="phone-template">
    <div class="screen">
      <div class="status-bar">
        <img src="/images/status.png" alt="状态栏" class="status-image">
        <div class="carrier">
          <img src="/images/中国移动.svg" alt="中国移动" class="carrier-logo">
        </div>
        <div class="time-display">
          <img src="/images/下午 4：49.svg" alt="下午 4：49" class="time-image">
        </div>
        <div class="status-icons">
          <img src="/images/信号.svg" alt="信号" class="status-icon signal-icon">
          <div class="battery-container">
            <img src="/images/电池3.svg" alt="电池头" class="battery-tip">
            <img src="/images/电池.svg" alt="电池" class="status-icon battery-icon">
            <div class="battery-level-container">
              <img src="/images/电池2.svg" alt="电量" class="battery-level">
              <img src="/images/battery-64.svg" alt="64%" class="battery-percentage">
            </div>
          </div>
        </div>
      </div>
      
      <div class="content">
        <slot></slot>
      </div>
      
      <div class="home-indicator"></div>
    </div>
  </div>
</template>

<script setup lang="ts">
// 手机模板组件，无需额外逻辑
</script>

<style scoped>
.phone-template {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.screen {
  width: 428px;
  height: 926px;
  background: transparent;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.status-bar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 25px 0 15px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  z-index: 5;
  flex-shrink: 0;
  height: 44px;
}

.status-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
}

.status-image {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  z-index: -1;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  opacity: 1;
  filter: brightness(0.8) contrast(1.2);
}

.carrier {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 2;
  position: absolute;
  left: 10px;
  top: 40%;
  transform: translateY(-50%);
}

.carrier-logo {
  height: auto;
  width: auto;
  max-height: 18px;
  max-width: 70px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.time-display {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.time-image {
  height: auto;
  width: auto;
  max-height: 18px;
  max-width: 80px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
  position: absolute;
  right: 15px;
  top: 40%;
  transform: translateY(-50%);
}

.status-icon {
  height: auto;
  width: auto;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.signal-icon {
  max-height: 16px;
  max-width: 14px;
}

.battery-container {
  display: flex;
  align-items: center;
  gap: 1px;
  position: relative;
}

.battery-tip {
  max-height: 3px;
  max-width: 2px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.battery-icon {
  max-height: 13px;
  max-width: 28px;
}

.battery-level-container {
  position: absolute;
  right: 1px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.battery-level {
  height: auto;
  width: auto;
  max-height: 10px;
  max-width: 17px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.battery-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 12px;
  max-width: 24px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.content::-webkit-scrollbar {
  display: none;
}

/* 底部安全区域 */
.home-indicator {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 5px;
  z-index: 5;
}

/* 响应式适配 */
@media (max-width: 480px) {
  .phone-template {
    padding: 0;
  }
  
  .screen {
    width: 100vw;
    height: 100vh;
  }
}

@media (max-height: 980px) {
  .phone-template {
    align-items: flex-start;
    padding-top: 20px;
  }
  
  .screen {
    height: calc(100vh - 40px);
    max-height: 926px;
  }
}

@media (max-height: 700px) {
  .phone-template {
    padding: 10px;
  }
  
  .screen {
    height: calc(100vh - 20px);
    max-height: none;
  }
}
</style> 